<%--
<%@ page import="dao.BlogDao" %>
<%@ page import="dao.impl.BlogDaoImpl" %>
<%@ page import="dao.FollowDao" %>
<%@ page import="dao.impl.FollowDaoImpl" %>
<%@ page import="entity.User" %>
<%@ page import="java.util.List" %>
<%@ page import="entity.Blog" %>
<%@ page import="service.BlogService" %>
<%@ page import="service.impl.BlogServiceImpl" %>
<%@ page import="service.FollowService" %>
<%@ page import="service.impl.FollowServiceImpl" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

&lt;%&ndash;微博的业务控制页面&ndash;%&gt;
<%
    //设置解码方式
    request.setCharacterEncoding("UTF-8");
    //获取值
    String opr=request.getParameter("opr");
    //获取“我的微博”页面搜索框的值
    String content=request.getParameter("content");
    if (content==null){
        content="";
    }
    //获取“首页”页面搜索框的值
    String content3=request.getParameter("content3");
    if (content3==null){
        content3="";
    }

    //创建业务逻辑对象
    BlogService blogService=new BlogServiceImpl();
    FollowService followService=new FollowServiceImpl();

    int uid=((User)session.getAttribute("user")).getId();

    //将微博数、关注数、粉丝数存到session会话当中
    session.setAttribute("blogCount",blogService.getBlogCount(uid));
    session.setAttribute("followCount",followService.getFollowCount(uid));
    session.setAttribute("fansCount",followService.getFansCount(uid));

    //去"我的微博"页面
    if (opr.equals("myBlogList")){
        List<Blog> blogList=blogService.getBlogList(uid,content);
        session.setAttribute("blogList",blogList);
        request.getRequestDispatcher("../pages/mywb.jsp").forward(request,response);
    //去首页
    }else if (opr.equals("HomeBlogList")){
        List<Blog> allblogList=blogService.getAllBlogList(uid,content3,uid,content3);
        session.setAttribute("allblogList",allblogList);
        request.getRequestDispatcher("../pages/home.jsp").forward(request,response);
    }







%>
--%>
